package adapter.interfaceadapter;

/**
 * @author shenhan
 * @create 2020/3/23 16:37
 * @description
 */
public class IServiceImpl {
    public void interfaceTest(IService iService) {
        System.out.println("执行调用主方法");
        iService.method1();
    }

    public static void main(String[] args) {
        final IServiceImpl iService = new IServiceImpl();
        iService.interfaceTest(new InterfaceAdapter() {
            @Override
            public void method1() {
                System.out.println("only method1");
            }
        });
    }
}
